package week1;

public class Ex4 {
    public static void main(String[] args) {
        int s = 0;
        for (int i = 999; i > 99; --i){
            for (int j = 999; j > 99; --j){
                if (ishuiwen(i * j)){
                    if (i * j > s)
                        s = i * j;
                }
            }
        }
        System.out.println(s);
    }
    public static boolean ishuiwen(int n){
        StringBuffer st = new StringBuffer(String.valueOf(n)).reverse();
        return Integer.parseInt(st.toString()) == n;
    }
}
